Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linter error from 2.1.0 (due to noarch: python) #174

Merged
merged 3 commits into from
Jul 26, 2024

Conversation

jakirkham
Copy link
Member

@jakirkham jakirkham commented Jul 26, 2024

The linter does not like having noarch: python at the top-level with selectors ( #167 (comment) ) ( conda-forge/conda-smithy#1887 (comment) ). Rewriting the recipe without selectors is a substantial lift and not worth it given the move towards rattler-build.

However if we don't have noarch or a skip at the top-level, a full matrix of Python versions is built out for all Python XGBoost packages (despite these packages being redundant). Example below taken from this CI run (attached log for posterity):

Packages generated by Python matrix in past CI run:
{
  "_py-xgboost-mutex-2.0-cpu_0.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "target_platform": "linux-64"
    }
  },
  "_r-xgboost-mutex-2.0-cpu_0.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "target_platform": "linux-64"
    }
  },
  "libxgboost-2.0.3-cpu_hce603c2_3.conda": {
    "recipe": {
      "__glibc": "__glibc >=2.17,<3.0.a0",
      "c_compiler": "gcc",
      "c_compiler_version": "12",
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "cuda_compiler_version": "None",
      "cxx_compiler": "gxx",
      "cxx_compiler_version": "12",
      "target_platform": "linux-64"
    }
  },
  "py-xgboost-2.0.3-cpu_pyh0a621ce_3.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "python": "3.11.* *_cpython",
      "target_platform": "linux-64"
    }
  },
  "py-xgboost-2.0.3-cpu_pyh78d450f_3.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "python": "3.10.* *_cpython",
      "target_platform": "linux-64"
    }
  },
  "py-xgboost-2.0.3-cpu_pyh995e691_3.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "python": "3.8.* *_cpython",
      "target_platform": "linux-64"
    }
  },
  "py-xgboost-2.0.3-cpu_pyhbc962bd_3.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "python": "3.12.* *_cpython",
      "target_platform": "linux-64"
    }
  },
  "py-xgboost-2.0.3-cpu_pyhc68e8b7_3.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "python": "3.9.* *_cpython",
      "target_platform": "linux-64"
    }
  },
  "py-xgboost-cpu-2.0.3-pyh099c497_3.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "python": "3.12.* *_cpython"
    }
  },
  "py-xgboost-cpu-2.0.3-pyh4f80c01_3.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "python": "3.10.* *_cpython"
    }
  },
  "py-xgboost-cpu-2.0.3-pyhac85b48_3.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "python": "3.9.* *_cpython"
    }
  },
  "py-xgboost-cpu-2.0.3-pyhb06c54e_3.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "python": "3.11.* *_cpython"
    }
  },
  "py-xgboost-cpu-2.0.3-pyhb8f9a19_3.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "python": "3.8.* *_cpython"
    }
  },
  "r-xgboost-2.0.3-cpu_r42h566b21a_3.conda": {
    "recipe": {
      "__glibc": "__glibc >=2.17,<3.0.a0",
      "c_compiler": "gcc",
      "c_compiler_version": "12",
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "cxx_compiler": "gxx",
      "cxx_compiler_version": "12",
      "target_platform": "linux-64"
    }
  },
  "r-xgboost-2.0.3-cpu_r43h566b21a_3.conda": {
    "recipe": {
      "__glibc": "__glibc >=2.17,<3.0.a0",
      "c_compiler": "gcc",
      "c_compiler_version": "12",
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "cxx_compiler": "gxx",
      "cxx_compiler_version": "12",
      "target_platform": "linux-64"
    }
  },
  "r-xgboost-cpu-2.0.3-r42hf5c67e3_3.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "target_platform": "linux-64"
    }
  },
  "r-xgboost-cpu-2.0.3-r43hf5c67e3_3.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "target_platform": "linux-64"
    }
  },
  "xgboost-2.0.3-cpu_pyh099c497_3.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "python": "3.12.* *_cpython"
    }
  },
  "xgboost-2.0.3-cpu_pyh4f80c01_3.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "python": "3.10.* *_cpython"
    }
  },
  "xgboost-2.0.3-cpu_pyhac85b48_3.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "python": "3.9.* *_cpython"
    }
  },
  "xgboost-2.0.3-cpu_pyhb06c54e_3.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "python": "3.11.* *_cpython"
    }
  },
  "xgboost-2.0.3-cpu_pyhb8f9a19_3.conda": {
    "recipe": {
      "channel_targets": "conda-forge main",
      "cuda_compiler": "None",
      "python": "3.8.* *_cpython"
    }
  }
}

To clean this up, we skip any Python version except the minimum one that XGBoost supports. This ensures we build for exactly one Python. To get the syntax right we need to use Jinja.

Unfortunately that means we need to consolidate our other skips into this one, which includes the Windows CUDA 11.8 skip. So we do so and try to make the syntax as pleasing as we can within the constraints.

That all being said, this does keep the linter happy and it re-renders without generated unneeded Python builds.


Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

The linter does not like having `noarch: python` at the top-level with
selectors. Rewriting the recipe without selectors is a substantial lift
and not worth it given the move towards rattler-build.

However if we don't have `noarch` or a `skip` at the top-level, a full
matrix of Python versions is built out for `xgboost` (despite these
packages being redundant).

To clean this up, we skip any Python version except the minimum one that
XGBoost supports. This ensure we build for exactly one Python. To get
the syntax right we need to use Jinja.

Unfortunately that means we need to consolidate our other `skip`s into
this one, which includes the Windows CUDA 11.8 skip. So we do so and try
to make the syntax as pleasing as we can within the constraints.
@conda-forge-webservices
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found it was in an excellent condition.

@jakirkham
Copy link
Member Author

@conda-forge-admin, please re-render

Copy link
Contributor

Hi! This is the friendly automated conda-forge-webservice.

I tried to rerender for you, but it looks like there was nothing to do.

This message was generated by GitHub actions workflow run https://github.com/conda-forge/xgboost-feedstock/actions/runs/10105806851.

@jakirkham jakirkham added the automerge Merge the PR when CI passes label Jul 26, 2024
@github-actions github-actions bot merged commit 44f5439 into conda-forge:main Jul 26, 2024
15 checks passed
Copy link
Contributor

Hi! This is the friendly conda-forge automerge bot!

I considered the following status checks when analyzing this PR:

  • linter: passed
  • azure: passed

Thus the PR was passing and merged! Have a great day!

@jakirkham jakirkham deleted the fix_linter branch July 26, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge the PR when CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant